package com.doubledr.light_lock.utils;

import android.content.Context;
import android.content.SharedPreferences;
import android.provider.Settings;

/**
 * 操作SharedPreferences对象的工具类
 */
public class ShareRefHelper {

    private static Context mContext;
    public static void init(Context context){
        mContext = context;
    }
    public static boolean saveValue(String name,String val){
        if (mContext == null){
            return false;
        }
        SharedPreferences sharedPreferences= mContext.getSharedPreferences("lightlock",Context.MODE_PRIVATE);
        SharedPreferences.Editor editor = sharedPreferences.edit();
        editor.putString(name,val);
        editor.commit();
        return true;
    }
    public static String getValue(String name){
        String val = "";
        if(mContext == null){
            return null;
        }
        SharedPreferences sharedPreferences= mContext.getSharedPreferences("lightlock",Context.MODE_PRIVATE);
        val = sharedPreferences.getString(name,"");
        return val;
    }
    public static String getFileID() {
        return "FileEn";
    }
    public static String getFolderID(){
        return "FolderEn";
    }
}
